package com.library.management.service.user.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.library.management.domain.user.User;
import com.library.management.mapper.user.UserMapper;
import com.library.management.service.user.UserService;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements UserService {
    
    @Override
    public User getByUsername(String username) {
        return this.getOne(new LambdaQueryWrapper<User>()
                .eq(User::getUsername, username));
    }

    @Override
    public List<User> getUserList() {
        return this.list(new LambdaQueryWrapper<User>().orderByDesc(User::getCreateTime));
    }
} 